﻿using HKTools;
using QFramework;
using UnityEngine;

public class Test_FPSSystem : MonoBehaviour, IController
{
    public IArchitecture GetArchitecture()
    {
        return HK_ArchitectureProvider.Architecture;
    }

    void Update()
    {
        // 显示 当前刷新率
        if (Input.GetKeyDown(KeyCode.F1))
        {
            this.SendCommand(new CMD_ShowFPSDisplay());
        }

        // 隐藏 当前刷新率
        if (Input.GetKeyDown(KeyCode.F2))
        {
            this.SendCommand(new CMD_HideFPSDisplay());
        }

        // 关闭 垂直同步，将目标刷新率设置为 60
        if (Input.GetKeyDown(KeyCode.F3))
        {
            this.SendCommand(new CMD_SetTargetFrameRate(60, false));
        }

        // 开启 垂直同步，不限制目标刷新率
        if (Input.GetKeyDown(KeyCode.F4))
        {
            this.SendCommand(new CMD_SetTargetFrameRate(-1, true));
        }
    }
}
